#ifndef ANIMATIONEDITOR_H
#define ANIMATIONEDITOR_H

#include <QWidget>
#include <SFML/Graphics.hpp>
#include "texturemanager.h"
#include "animationmanager.h"
#include <Shinygami/spriteanimate.hpp>

namespace Ui {
class AnimationEditor;
}

class AnimationEditor : public QWidget
{
    Q_OBJECT

public:
    explicit AnimationEditor(QWidget *parent = 0);
    ~AnimationEditor();

    void SetTextureManager(TextureManager* tm);
    void SetAnimationManager(AnimationManager* am) { _animationManager = am; }

private slots:
    void ChangeTexture();
    void TextureAdded(QString);
    void UpdateShape(void);
    void UpdateAnimation(void);
    void ShowTexture(void);
    void ShowAnimation(void);
    void LoadAnimation(QString);

private:
    Ui::AnimationEditor               *ui;
    sf::RectangleShape                _shape;
    TextureManager*                   _textureManager;
    AnimationManager*                 _animationManager;
    AnimationManager::Pair*           _animationData;
    Shiny::SpriteAnimate::Animation*  _animation;
    bool                              _loading;
};

#endif // ANIMATIONEDITOR_H
